    /*
  modified on Sep 28, 2020
  Modified by MohammedDamirchi from
  https://github.com/igorantolic/ai_ap3216_ambient-light-and-proximity-sensor-library
  Home
*/



// Hardware wiring:
// Arduino     AP3216
//             VLED --,
// GND ------- GND   |R| 330 Ohm
// 3.3V ------ VCC ---'
// A5 -------- SCL
// A4 -------- SDA
            

#include "Ai_AP3216_AmbientLightAndProximity.h"

Ai_AP3216_AmbientLightAndProximity aps = Ai_AP3216_AmbientLightAndProximity();
//Ai_AP3216_AmbientLightAndProximity aps = Ai_AP3216_AmbientLightAndProximity(D5, D6);//custompins

void setup() {
  Serial.begin(115200);
  aps.begin();
  aps.startAmbientLightAndProximitySensor ();
}

void loop() {
  long alsValue = aps.getAmbientLight();
  long psValue = aps.getProximity();

  Serial.print("Ambient Light: ");
  Serial.print(alsValue);
  Serial.print(", Proximity: ");
  Serial.println(psValue);

  delay(200);
  de  }
